package com.demo;

import java.util.concurrent.atomic.AtomicLong;

public class TestRunnable implements Runnable 
{
	private int id;
	public static AtomicLong ID = new AtomicLong(0);
	private boolean bool;
	
	@Override
	public void run() 
	{
		for (int i=0; i<100; i++) 
		{
			if(bool)
			{
				ID.set(ID.get() + 1);
			}
			else
			{
				ID.set(ID.get() - 1);
			}
			
			
			System.out.println(this.getClass().getName() + id + " : " + (ID));
		}
	}
	
	public TestRunnable(int id, boolean bool)
	{
		this.id = id;
		this.bool = bool;
	}
}
